package com.wulis.provider.authority.mapper;

import com.wulis.provider.authority.model.bo.RoleBo;
import com.wulis.provider.authority.model.vo.QueryRoleListVo;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wulis.common.support.BaseMapper;
import com.wulis.provider.authority.model.entity.Role;
import com.wulis.provider.authority.model.vo.QueryRolePageVo;
import com.wulis.provider.authority.model.vo.QueryRoleVo;

import java.util.List;
import java.util.Set;

/**
 * 权限管理:角色表 Mapper
 *
 * @author WuliBao
 * @date 2020-04-17
 */
public interface RoleMapper extends BaseMapper<Role> {
    
    /**
     * WEB:查询角色列表(分页)
     * 
     * @param page page
     * @param roleName roleName
     * @param roleMark roleMark
     * @param enable enable
     * @return IPage
     */
    IPage<QueryRolePageVo> queryRolePage(Page<QueryRolePageVo> page, @Param("roleName") String roleName,
        @Param("roleMark") String roleMark, @Param("enable") Integer enable);
    
    /**
     * WEB:查询角色列表(全量)
     *
     * @param enable enable
     * @return role list
     */
    List<QueryRoleListVo> queryRoleList(@Param("enable") Integer enable);
    
    /**
     * WEB:查询角色及权限信息
     * 
     * @param roleId roleId
     * @return QueryRoleVo
     */
    QueryRoleVo queryRole(@Param("roleId") Long roleId);
    
    /**
     * WEB:查询全部角色及对应的菜单按钮权限集合
     * 
     * @return Set
     */
    Set<RoleBo> queryAllRoleButton();
    
}
